using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._EditingTools
{
    /// <summary>
    /// <para>Densify</para>
    /// <para>Adds vertices along line or polygon features and replaces curve segments (Bezier, circular arcs, and elliptical arcs) with line segments.</para>
    /// <para>沿线或面要素添加折点，并将曲线线段（贝塞尔弧、圆弧和椭圆弧）替换为线段。</para>
    /// </summary>    
    [DisplayName("Densify")]
    public class Densify : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Densify()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The polygon or line feature class to be densified.</para>
        /// <para>要密集化的面或线要素类。</para>
        /// </param>
        public Densify(object _in_features)
        {
            this._in_features = _in_features;
        }
        public override string ToolboxName => "Editing Tools";

        public override string ToolName => "Densify";

        public override string CallName => "edit.Densify";

        public override List<string> AcceptEnvironments => ["autoCommit", "workspace"];

        public override object[] ParameterInfo => [_in_features, _densification_method.GetGPValue(), _distance, _max_deviation, _max_angle, _out_feature_class, _max_vertex_per_segment];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The polygon or line feature class to be densified.</para>
        /// <para>要密集化的面或线要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Densification Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the feature densification method to be used.</para>
        ///   <bulletList>
        ///     <bullet_item>Distance—Straight lines and curves will be densified using the specified distance. This is the default.</bullet_item><para/>
        ///     <bullet_item>Offset—Curves will be densified using the specified maximum offset deviation.</bullet_item><para/>
        ///     <bullet_item>Angle—Curves will be densified using the specified maximum deflection angle.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要使用的特征致密化方法。</para>
        ///   <bulletList>
        ///     <bullet_item>距离—直线和曲线将使用指定的距离进行致密化。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>偏移 （Offset） - 将使用指定的最大偏移偏差对曲线进行致密化。</bullet_item><para/>
        ///     <bullet_item>角度 （Angle） - 将使用指定的最大偏转角对曲线进行致密化。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Densification Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _densification_method_value _densification_method { get; set; } = _densification_method_value._DISTANCE;

        public enum _densification_method_value
        {
            /// <summary>
            /// <para>Distance</para>
            /// <para>Distance—Straight lines and curves will be densified using the specified distance. This is the default.</para>
            /// <para>距离—直线和曲线将使用指定的距离进行致密化。这是默认设置。</para>
            /// </summary>
            [Description("Distance")]
            [GPEnumValue("DISTANCE")]
            _DISTANCE,

            /// <summary>
            /// <para>Offset</para>
            /// <para>Offset—Curves will be densified using the specified maximum offset deviation.</para>
            /// <para>偏移 （Offset） - 将使用指定的最大偏移偏差对曲线进行致密化。</para>
            /// </summary>
            [Description("Offset")]
            [GPEnumValue("OFFSET")]
            _OFFSET,

            /// <summary>
            /// <para>Angle</para>
            /// <para>Angle—Curves will be densified using the specified maximum deflection angle.</para>
            /// <para>角度 （Angle） - 将使用指定的最大偏转角对曲线进行致密化。</para>
            /// </summary>
            [Description("Angle")]
            [GPEnumValue("ANGLE")]
            _ANGLE,

        }

        /// <summary>
        /// <para>Distance</para>
        /// <para><xdoc>
        ///   <para>The maximum distance between vertices. This distance will always be applied to line segments and to simplify curves. The default value is a function of the data's x,y tolerance.</para>
        ///   <para>New vertices may not be inserted at this exact interval along the line, rather they will be inserted within this distance of the previous vertex. There is no way to ensure that a vertex is added exactly at the specified interval along the line segment.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>顶点之间的最大距离。此距离将始终应用于线段并简化曲线。默认值是数据的 x，y 容差的函数。</para>
        ///   <para>新顶点可能不会沿线以此确切间隔插入，而是将插入在前一个顶点的此距离内。无法确保沿线段以指定的间隔精确添加顶点。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _distance { get; set; } = "0 Unknown";


        /// <summary>
        /// <para>Maximum Offset Deviation</para>
        /// <para>The maximum distance the output segment will be from the original. This parameter only affects curves. The default value is a function of the data's x,y tolerance.</para>
        /// <para>输出段与原始段的最大距离。此参数仅影响曲线。默认值是数据的 x，y 容差的函数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Offset Deviation")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _max_deviation { get; set; } = "0 Unknown";


        /// <summary>
        /// <para>Maximum Deflection Angle (Degrees)</para>
        /// <para>The maximum angle the output geometry can be from the input geometry. The valid range is 0 to 90. The default value is 10. This parameter only affects curves.</para>
        /// <para>输出几何体可以与输入几何体成交的最大角度。有效范围为 0 到 90。默认值为 10。此参数仅影响曲线。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Deflection Angle (Degrees)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _max_angle { get; set; } = 10;


        /// <summary>
        /// <para>Updated Input Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Maximum Vertex Count (per segment)</para>
        /// <para>The maximum vertex count allowed per segment. If no value or an invalid value (0 or less) is entered, there will be no vertex limit for linear segments, and curve segments will have a default of 12000.</para>
        /// <para>每个段允许的最大顶点计数。如果未输入值或输入无效值（0 或更小），则线性线段将没有顶点限制，曲线线段的默认值为 12000。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Vertex Count (per segment)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _max_vertex_per_segment { get; set; } = null;


        public Densify SetEnv(int? autoCommit = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, workspace: workspace);
            return this;
        }

    }

}